<div id="accordion">
    <?php if( count( $etape ) > 0 ) : ?>
        <?php foreach( $etape as $etapa ) : ?>
            <h3> <?php echo $etapa['Stage']['name'] ?> </h3>
            <div>
                <div class="stage_date"> Data limita: <?php echo $etapa['Stage']['limit_date']; ?> </div>
                <div class="stage_desc"> <?php echo $etapa['Stage']['description']; ?> </div>
                <?php foreach( $etapa['Task'] as $task ) : ?>
                    <div class="stage_task">
                        <div> <?php echo $task['name']; ?> </div>
                        <?php
                        if ($task['check_profesor'])
                            $class = "fa-check-circle-o check_profesor";
                            else
                            if ($task['check_student'])
                            $class = " fa-check-circle-o";
                            else
                            $class = " fa-circle-o";
                            echo $this->Form->checkbox( null, array(
                                "class"    => "mark-check " ,
                                "checked"  => $task['check_student'] ? true : false,
                                "value"    => $task['check_student'],
                                "data-ref" => "0-0-" . $task['id']
                            ) );
                        ?>
                        <i class="fa <?=$class?>"></i>
                    </div>
                <?php endforeach; ?>
            </div>
                
        <?php endforeach; ?>
        <h3>Documentatie</h3>
        <div>
            <?php
                foreach ($theme['Extra'] as $extra)
                {
                    echo '<a class="extra_link" href="'.SITE_URL.$extra['path'].'">'.$extra['name'].'</a>';
                }
            ?>
        </div>
            
    <?php else: ?>
        Nicio Etapa gasita!
    <?php endif; ?>
</div>

<form action="<?= SITE_URL ?>/students/upload_file/<?= $theme['Theme']['id'] ?>"
      class="dropzone"></form>
        				